﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BT_DoHoa_Nhom13.ShapeLib.FCShapes
{
    public class FCConditionShape : MyDiagramShape
    {
        public FCConditionShape()
        {
            // TODO: Complete member initialization
            lstShapes = new List<MyShape>();

            //2 mui ten ben trai
            lstShapes.Add(new MyLine());
            lstShapes.Add(new MyLine());

            //2 mui ten ben phai
            lstShapes.Add(new MyLine());
            lstShapes.Add(new MyLine());
        }

       

        public override MyShape Clone()
        {
            return new FCConditionShape();
        }

        public override MyShape CloneByDiagramFactory(DiagramFactorys.MyDiagramFactory factory)
        {
            MyShape newShape = factory.GetConditionShape();
            newShape.Copy(this);
            return newShape;
        }

        public override void ResetChildPoint()
        {
            int top, left, width, height;
            this.SetConfig(out top,out left,out width,out  height);

            lstShapes[0].SetStartPoint(left, top + height /2);
            lstShapes[0].SetEndPoint(left + width / 2, top);

            lstShapes[1].SetStartPoint(left, top + height/2);
            lstShapes[1].SetEndPoint(left + width / 2, top + height);
            
            lstShapes[2].SetStartPoint(left + width/2, top);
            lstShapes[2].SetEndPoint(left + width, top + height / 2);

            lstShapes[3].SetStartPoint(left + width / 2, top + height);
            lstShapes[3].SetEndPoint(left + width, top + height/2);
            
        }
    }
}
